package edu.mse.camel.client.events.server;

import edu.mse.camel.client.events.AbstractEvent;
import edu.mse.camel.client.events.EventIDs;
import edu.mse.camel.client.events.IEvent;

public class SemaphoreEvent extends AbstractEvent implements IEvent {
	
	public enum SemaphoreOperation {Create, TryAcquire, Release };
	
	private SemaphoreOperation op;
	
	boolean idValid;
	int id;
	
	public SemaphoreEvent(SemaphoreOperation op) {
		this.setOp(op);
		this.idValid = false;
		this.id = -1;
	}
	
	@Override
	public String getEventID() {
		return EventIDs.SEMAPHORE_EVENT;
    }

	public boolean isIdValid() {
		return idValid;
	}

	public void setIdValid(boolean idValid) {
		this.idValid = idValid;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public void setOp(SemaphoreOperation op) {
		this.op = op;
	}

	public SemaphoreOperation getOp() {
		return op;
	}
}
